package main

import "fmt"

//传值
func zeroval(ival int) {
	ival = 0
}

//传指针
func zeroptr(iptr *int) {
	*iptr = 0
}

func main() {
	i := 1
	fmt.Println("init", i)
	//不改变i值
	zeroval(i)
	fmt.Println("zeroval:", i)
	//改变i值
	zeroptr(&i)
	fmt.Println("pointer:", &i)
	fmt.Println("zeroptr:", i)

}
